/*
 * @Descripttion:
 * @version:
 * @Author: ChenXiang
 * @Date: 2021-04-13 17:24:46
 * @LastEditors: ChenXiang
 * @LastEditTime: 2021-04-13 17:39:29
 */
import { useState } from "react";

const useSwitch = (defaultStatus = false) => {
  const [visible, setVisible] = useState(defaultStatus);
  const toggle = () => setVisible(!status);
  const setOpen = () => setVisible(true);
  const setClose = () => setVisible(false);
  return {
    setOpen,
    setClose,
    visible,
    setVisible,
    toggle
  };
};

export default useSwitch;
